package com.cwnu.entity;

import com.fasterxml.jackson.annotation.JsonIgnore;
import jakarta.validation.constraints.NotNull;

public class User {
    @NotNull
    private Integer id; // 用户id

    @NotNull
    private String username; // 用户姓名
    @JsonIgnore
    private String password; // 用户密码

    @NotNull
    private Integer age; // 用户年龄

    @NotNull
    private String school; // 用户所在学校

    private Integer role;


    public User() {
    }

    public User(Integer id, String username, String password, Integer age, String school, Integer role) {
        this.id = id;
        this.username = username;
        this.password = password;
        this.age = age;
        this.school = school;
        this.role = role;
    }

    /**
     * 获取
     * @return id
     */
    public Integer getId() {
        return id;
    }

    /**
     * 设置
     * @param id
     */
    public void setId(Integer id) {
        this.id = id;
    }

    /**
     * 获取
     * @return username
     */
    public String getUsername() {
        return username;
    }

    /**
     * 设置
     * @param username
     */
    public void setUsername(String username) {
        this.username = username;
    }

    /**
     * 获取
     * @return password
     */
    public String getPassword() {
        return password;
    }

    /**
     * 设置
     * @param password
     */
    public void setPassword(String password) {
        this.password = password;
    }

    /**
     * 获取
     * @return age
     */
    public Integer getAge() {
        return age;
    }

    /**
     * 设置
     * @param age
     */
    public void setAge(Integer age) {
        this.age = age;
    }

    /**
     * 获取
     * @return school
     */
    public String getSchool() {
        return school;
    }

    /**
     * 设置
     * @param school
     */
    public void setSchool(String school) {
        this.school = school;
    }

    /**
     * 获取
     * @return role
     */
    public Integer getRole() {
        return role;
    }

    /**
     * 设置
     * @param role
     */
    public void setRole(Integer role) {
        this.role = role;
    }

    public String toString() {
        return "User{id = " + id + ", username = " + username + ", password = " + password + ", age = " + age + ", school = " + school + ", role = " + role + "}";
    }
}
